<?php

namespace Acme\Likipe\BlogBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Acme\Likipe\BlogBundle\Entity\Blog
 *
 * @ORM\Table(name="blog")
 * @ORM\Entity
 * @ORM\Entity(repositoryClass="Acme\Likipe\BlogBundle\Repository\BlogRepository")
 */
class Blog
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    
    /**
     * @var string $title
     *
     * @ORM\Column(name="title", type="string", length=255)
     * @Assert\NotBlank()
     * @Assert\MinLength(
     * 			limit=10, 
     * 			message="Your title must have at least {{ limit }} characters."
     * )
     */
    private $title;

    
    /**
     * @var datetime $created
     *
     * @ORM\Column(name="created", type="datetime")
     
     */
    private $created;

    
    /**
     * @var integer $maximum
     *
     * @ORM\Column(name="maximum", type="integer")
     * @Assert\NotBlank()
     * @Assert\Max(
     * 		limit=10,
     * 		message="Your maximim must be 10 or under to enter."
     * )
     */
    private $maximum;
    
    
    /**
     * @ORM\OneToMany(targetEntity="Post", mappedBy="blog")
     */
    protected $posts;
    
    public function __construct()
    {
        $this->posts = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     */
    public function setTitle($title)
    {
        $this->title = $title;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set created
     *
     * @param datetime $created
     */
    public function setCreated($created)
    {
        $this->created = $created;
    }

    /**
     * Get created
     *
     * @return datetime 
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set maximum
     *
     * @param integer $maximum
     */
    public function setMaximum($maximum)
    {
        $this->maximum = $maximum;
    }

    /**
     * Get maximum
     *
     * @return integer 
     */
    public function getMaximum()
    {
        return $this->maximum;
    }

    /**
     * Add posts
     *
     * @param Acme\Likipe\BlogBundle\Entity\Post $posts
     */
    public function addPost(\Acme\Likipe\BlogBundle\Entity\Post $posts)
    {
        $this->posts[] = $posts;
    }

    /**
     * Get posts
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getPosts()
    {
        return $this->posts;
    }
}